package com.estar.assistsurvy.thread;

import com.estar.assistsurvy.constant.Constants;
import com.estar.assistsurvy.entity.RequestWalletChange;
import com.estar.assistsurvy.entity.ResponseWalletChange;

import android.content.Context;
import android.os.Handler;
import android.util.Log;

public class WalletChangeThread extends BaseThread {

	private RequestWalletChange walletChange;

	public WalletChangeThread(Context context, Handler handler, RequestWalletChange walletChange) {
		super(context, handler);
		this.walletChange = walletChange;
	}
	
	@Override
	public void run() {
		// TODO Auto-generated method stub
		url_str=Constants.NAMESPACE+Constants.WALLETCHANGE;
		json=gson.toJson(walletChange);
		postRequest(url_str, json);
		if(result!=null){
			Log.i("wl", "请求钱包总金额返回值"+result);
			ResponseWalletChange wallet=new ResponseWalletChange();
			wallet=gson.fromJson(result, ResponseWalletChange.class);
			msg.what=0;
			msg.obj=wallet;
			msg.sendToTarget();
		}
	}
}
